/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.logical.allhit;

import java.io.PrintWriter;
import java.io.StringWriter;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 * Entry Point of this application. this class also call Kernel of app.
 * @author Sanjeet Jha
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       try {
            Kernel.getInstance().launch(args);
            Runtime.getRuntime().addShutdownHook(new Shutdown());
        } catch (Exception err) {
            StringWriter swriter = new StringWriter();
            PrintWriter writer = new PrintWriter(swriter);
            err.printStackTrace(writer);
            writer.flush();
            JOptionPane.showMessageDialog(new JFrame(), "An unexpected error "
                    + "occurred during application startup:\r\n" +
                    swriter.toString(), "ERROR", JOptionPane.ERROR_MESSAGE);
            System.exit(1);
        }
    }
}
